The IP multimedia subsystem (abbreviated as IMS) is an IP-based network architecture proposed by the 3rd Generation Partnership Project (abbreviated as 3GPP), which system constructs an open and flexible service environment, supports multimedia applications, and can provide abundant multimedia services for users.
FIG. 1A is a schematic diagram of the IMS media path optimization in relevant art, which describes different media paths between an IMS calling terminal UE1 and an IMS called terminal UE2 as well as corresponding signaling paths. As shown in FIG. 1A, the media path established by the currently available call process is: UE1, transmit gateway (abbreviated as TrGW) 1, TrGW2, TrGW3, TrGW4, UE2, while the optimized media path is: UE1, TrGW1, TrGW4, UE2, so the optimized media path is shorter than the un-optimized media path, with two TrGWs reduced, therefore the optimized media path saves resources and also improves efficiency. In this case, the signaling gateway application layer gateway (abbreviated as ALG) 1 controls TrGW1, ALG2 controls TrGW2, ALG3 controls TrGW3, and ALG4 controls TrGW4.
FIG. 1B is a flow chart of the IMS media path optimization in relevant art, which corresponds to the schematic diagram of FIG. 1A and mainly comprises the following steps:
Step 101: UE1 sends a session description protocol (abbreviated as SDP) request to UE2 to negotiate the media resource information, for example, by sending a call signaling of SIP (i.e. an INVITE request), the message body of the session initiation protocol (abbreviated as SIP) request including this SDP request, and the content of the SDP request is the media resource information of UE1;
Steps 102 to 103: The SDP request arrives at signaling gateway ALG1, and the signaling gateway ALG1 selects TrGW1 as a media gateway; ALG1 first checks whether there is a node which can be directly linked thereto in the node information recorded in the SDP request, and there is no such node in this example, then it controls this media gateway to use the media resource information in the SDP request and allocates the media resource for backward connection; ALG1 replaces the media resource information in the SDP request with the media resource information for backward connection of TrGW1, and then forwards the SDP request after adding the node information controlled by ALG1 into this SDP request, which node information contains the forward accessible domain information of TrGW1, which includes the connection information, domain name information, etc. of the corresponding media (i.e. the media connection information of UE1) in the SDP; and the SDP request can be forwarded by way of, for example, being included in an SIP signaling;
Steps 104 to 105: The SDP request arrives at signaling gateway ALG2, and ALG2 selects TrGW2 as a media gateway; ALG2 first checks whether there is a node which can be directly linked thereto in the node information recorded in the SDP request, and there is no such node in this example, then it controls this media gateway to use the media resource information in the SDP request and allocates the media resource for backward connection; ALG2 replaces the media resource information in the SDP request with the media resource information for backward connection of TrGW2 and then forwards the SDP request after adding the node information controlled by ALG2 into the SDP request, which node information contains the forward accessible domain information of TrGW2, which includes the connection information, domain name information, etc. of the corresponding media (i.e. the backward media connection information of TrGW1) in the SDP; The SDP request can be forwarded by way of, for example, being included in an SIP signaling;
Steps 106 to 107: The SDP request arrives at signaling gateway ALG3, and ALG3 selects TrGW3 as a media gateway; ALG3 first checks whether there is a node which can be directly linked thereto in the node information recorded in the SDP request, and there is no such node in this example, then it controls this media gateway to use the media resource information in the SDP request and allocates the media resource for backward connection; ALG3 replaces the media resource information in the SDP request with the media resource information for backward connection of TrGW3 and then forwards the SDP request after adding the node information controlled by ALG3 into the SDP request, which node information contains the forward accessible domain information of TrGW1, which includes the connection information, domain name information, etc. of the corresponding media (i.e. the backward media connection information of TrGW2) in the SDP; and the SDP request can be forwarded by way of, for example, being included in an SIP signaling;
Steps 108 to 109: The SDP request arrives at signaling gateway ALG4, and ALG4 selects TrGW3 as a media gateway; ALG4 first checks whether there is a node which can be directly linked thereto in the node information recorded in the SDP request, and in this example, the forward of TrGW4 can be directly backward-linked to TrGW1 (the backward connection information and domain name information of TrGW1 are provide by ALG2, and ALG4 checks there is a node which can be directly linked thereto in the front according to the domain name), then it controls this media gateway to use the media resource information provided by the node information which is found in the SDP request, i.e. the backward media connection information of TrGW1, and allocates the media resource for backward connection of TrGW4; ALG4 replaces the media resource information in the SDP request with the media resource information for backward connection of TrGW4, then ALG4 deletes the node information after the node which is found, and then forwards the SDP request, for example, by way of including it in an SIP signaling;
Step 110: The SDP request arrives at UE2, and UE2 uses the media resource information in the SDP request and sends an SDP response including the media resource information of UE2, for example, by a “200 OK” reply of an SIP signaling, the message body of this SIP reply including the SDPP response, and this SDP response arrives at ALG4;
Step 111: ALG4 checks whether there is there is node information of itself in the response, and in this example, there is no node information in this step, since ALG4 has found an optimized path, thus the node information is included in the SDP response, which information includes the media connection address information for forward connection of TrGW4 and the sequence number of the node which can be directly linked thereto (in this example, the sequence number is 2, i.e. the second node—which can be directly linked to TrGW1, and the first node in this example is UE1); and ALG4 replaces the media resource information in the SDP response with the media resource information for forward connection of TrGW4 and then forwards the SDP response, which SDP response arrives at ALG3;
Step 112: ALG3 checks whether there is there is node information of itself in the response, and in this example, there is no node information relative to itself in this step (which is determined according to the sequence number), however, since the node information is included in the SDP response, TrGW3 can be bypassed, thus the resource of TrGW3 is released and the SDP response is forwarded, which SDP response arrives at ALG2;
Step 113: ALG2 checks whether there is node information of itself in the response, and in this example, there is no node information relative to itself in this step (which is determined according to the sequence number, and the sequence number being 2 indicates that the node information is added by ALG2), then ALG2 replaces the connection information of the corresponding media in the SDP response with the connection information (i.e. the forward media connection information of TrGW4) in the node information and forwards the SDP response after deleting the node information in the SDP response; and since the node information is included in the received SDP response, TrGW2 can be bypassed, thus ALG2 releases the resource of TrGW2, and the SDP response arrives at ALG1; and
Step 114: ALG1 checks whether there is node information of itself in the response, and in this example, there is no node information in this step, so it replaces the media resource information in the SDP response with the media resource information for forward connection of TrGW1, and then forwards the SDP response, which SDP response arrives at ALG3; till now, an optimized media path is established, which media path is: UE1, TrGW1, TrGW4, and UE2.
In the above media path optimization procedure, since only the forward media connection information of each ALG is recorded in the node information of the SDP request, the ALG which receives the SDP request is unable to determine whether an ALG which does not support optimization algorithm is included in the path passed by the SDP request and regards all the ALGs as the ALGs which support optimization algorithm, so that it is possible to get a wrong optimized media path and even cause the failure of subsequent communication when there is an ALG which does not support optimization algorithm in the path. For example, in the above procedure, if ALG3 is un-enhanced (i.e. it does not support optimization algorithm), then it does not modify the node information in the SDP request when receiving the SDP request but forwards it directly; in step 108, ALG4 can find a directly connected node TrGW1 according to the node information in the SDP request and uses the media connection information of TrGW1, therefore the above optimized media path can be finally established; while in step 112, ALG3 will establish the media connection between TrGW3 and TrGW4 as well as TrGW2 according to normal steps, but does not release the resource of TrGW3, thus causing the optimized media path which is finally established to be wrong.
Moreover, if ALG3 further provides a new codec and this codec is finally selected by UE2 to use, then it may cause TrGW1 and TrGW4 to use different codecs for communication respectively, thus leading to the failure of subsequent communication. FIG. 1C is a schematic diagram of the flow chart of the IMS media path optimization going wrong in relevant art, which corresponds to the flow chart in FIG. 1B; it is assumed that ALG1 supports codecs a and b, ALG3 adds codec c, UE2 selects codec c, ALG4 also selects to use codec c, and ALG3 notices that the forward only supports codecs a and b, so it selects to carry out format conversion between codecs c and a and informs the forward to use codec a, and ALG1 will finally select to use codec a. Therefore, UE1 uses codec a to send media to TrGW1 which is controlled by ALG1, TrGW1 forwards media to TrGW4, and TrGW4 forwards media to UE2, however, UE2 selects to use codec c to receive media, which results in that it is unable to perform decoding; in contrast, UE2 uses codec c to send media to TrGW4 which is controlled by ALG4, TrGW4 forwards media to TrGW1, and TrGW1 forwards media to UE1, however, UE1 selects to use codec a to receive media, therefore it is unable to carry out decoding, thereby causing communication failure.
It can be seen from this that in relevant art since it is unable to determine whether an ALG which does not support optimization algorithm is contained in a path of the SDP request during the process of media path optimization, thus it causes the finally obtained optimized media path to be wrong and this wrong optimized media path will further cause communication failure.